﻿#ifndef DAT_WRITE_BACK_H
#endif DAT_WRITE_BACK_H

#include <vector>

typedef struct Line
{
	int StartNum;
	int EndNum;
	std::string ShuntFlag;
};
class DatWriteBack
{
public:
	DatWriteBack(const char* database,
	int caseid,
	std::vector <std::string> Zone,
	std::vector <double> Voltage,
	std::string InFile,
	std::string OutFile);
    DatWriteBack(const char* database, int caseid, std::string outFile);
	~DatWriteBack();

	const char* database;
	int caseid;
	std::vector <std::string> Zone;
    // voltage could be two same value
	std::vector <double> Voltage;
	std::string InFile;
	std::string OutFile;

	//get N-1 dat
	std::string GetBaseName();
	std::string GetCtrlInfor();

	void GetN_1DatFromDb();

	//get base dat
	//annotate lines 注释线路
	void GetBaseDatFromDb(std::vector <Line> AnnotateLines);
	
private:
	std::string ZeroDelet(double Factor, int n);
	std::string PointRight(double Voltage);
};